MuleSoft Accelerators - Setup Guide icon

MuleSoft Accelerators - Setup Guide

(0 reviews)

Application deployment

This release of the MuleSoft Accelerators for Salesforce Clouds simplifies the deployment of applications to CloudHub by leveraging Maven profiles to consolidate the required settings and credentials needed for all deployments. Additional profiles can also be created to support non-CloudHub deployments.

Configuring the deployment profile

The default settings-accelerators.xml file, provided by the "Accelerator Common Build" asset, defines a single deployment profile called CloudHub-DEV. The key properties that can be configured are described in the following table.

Property NameDescriptionMandatory
anypoint.usernameLogin user for target Anypoint instanceyes
anypoint.passwordLogin password for target Anypoint Instanceyes
anypoint.platform.clientIdClient ID of the target environment or business groupyes
anypoint.platform.clientSecretClient secret of the target environment or business groupyes
anypoint.platform.visualizerLayerThe default layer for the Visualizer if not set by the applicationno
cloudhub.regionTarget deployment regionyes
cloudhub.businessGroupIdID (not name) of the target business groupyes
cloudhub.environmentExact name of the target deployment environment (case-sensitive)yes
cloudhub.applicationNameConstructs the deployed application name from app/env propertiesyes
cloudhub.muleVersionTarget Mule runtime versionyes
cloudhub.workerTypeWorker size (translates to vCores)yes
cloudhub.workersNumber of workersyes
cloudhub.objectStoreV2Set to true to use ObjectStore V2no
cloudhub.persistentQueuesSet true to use persistent queuesno
cloudhub.skipDeploymentVerificationSet to false to wait for application to be fully deployed before continuingno
cloudhub.deploymentTimeoutAmount of time (in milliseconds) to wait for complete application deploymentno
cloudhub.encryptionKeyIf secured properties are used the encryption key is requiredno

Application naming

The default setting for the cloudhub.applicationName property constructs the application name base on the following segments:

  • Global Prefix (default is none)
  • Maven artifact ID (from project pom.xml)
  • API compliance version (from project pom.xml)
  • Target environment name (hard-coded for profile)

An example of a deployed application name using the default settings would be accel-jira-sys-api-v1-dev.

Important note: Since CloudHub application names must be globally unique, it is strongly recommended to set the global.cloudhub.appPrefix property (defined in the global-settings profile) to a short, 2-4 character abbreviation unique to your organization. Do not exceed 4 characters or deployments may fail (see below).

Deploying applications

Once appropriate values have been defined for the properties for the environment profile, individual applications can be deployed to that environment simply by specifying the profile name on the Maven command line. For example, the command mvn clean package mule:deploy -DskipTests -PCloudHub-DEV would use the settings in the CloudHub-DEV profile to build and deploy the application.

The common build project also includes some Maven configuration files to assist in deploying multiple applications - in the correct order - at once. For example, to deploy all components of the MuleSoft Accelerator for Service Cloud you would run the following command from within the accelerator-common-build project directory:

mvn -f servicecloud-build-pom.xml clean package mule:deploy -DskipTests -PCloudHub-DEV

Important note: for the above command to work, you must have already downloaded the dependent projects and extracted them to the same folder the accelerator-common-build is located under.

In this example, the following projects must be located in the Studio workspace as peers to the common build project:

  • accelerator-jira-sys-api
  • accelerator-oms-sys-api
  • accelerator-salesforce-odata-api
  • accelerator-salesforce-sys-api
  • accelerator-servicenow-sys-api
  • accelerator-case-prc-api
  • accelerator-customers-prc-api
  • accelerator-case-listener
  • accelerator-salesforce-topic-listener
  • accelerator-jira-exp-api
  • accelerator-salesforce-exp-api
  • accelerator-servicenow-exp-api

Use the given build configs as a starting point; you can always adjust the module references to suit your own needs.

Importing projects into Anypoint Studio

If you choose to import accelerator projects into Anypoint Studio, be aware that Studio may automatically make modifications to the application pom.xml files, which could impact deployment. In particular, be sure to cancel the prompt to "Upgrade your workspace" when importing projects. If you run into trouble, check the pom.xml file and verify the configuration of the mule-maven-plugin looks something like this:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <cloudHubDeployment>
        ...
        </cloudHubDeployment>
        <classifier>${mule.app.classifier}</classifier>
    </configuration>
</plugin>

In particular, make sure there is no <version> element included and that the <classifier> element contains the property reference indicated above.

Troubleshooting

If deployment fails due to an "unauthorized" error it is possible that the complete application name exceeds the 42 character limit on CloudHub deployment names. Adjust either the prefix, the artifactId value in the project pom.xml, or the deployment name pattern to ensure the complete application name does not exceed 42 characters in length.


Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onOct 30, 2020
Asset overview

Asset versions for 1.3.x

Asset versions
VersionActions
1.3.0